using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class Chromosome 
{
	public Chromosome() {
		
	}
	
	public Chromosome(ChromosomeType type, int min, int max) {
		this.type= type;
		this.min= min;
		this.max= max;
	}
	
	public Chromosome(Chromosome copy) {
		this.type= copy.type;
		this.min= copy.min;
		this.max= copy.max;
	}
	
	public enum ChromosomeType { 
		STRENGTH,
		SMARTS,
		SPEED,
		DEFENSE,
		ATTACK 
	};
		
	private ChromosomeType type;
	private int min;
	private int max;
	private List<GameObject> phenotype= new List<GameObject>(); //where we store the chormosomes physical representation
	
	public ChromosomeType Type {
		get { return type; } 
	}
	public int Min {
		get { return min; }
		set { min= value; }
	}
	public int Max {
		get { return max; }
		set { max= value; }
	}
	
	public List<GameObject> Phenotype {
		get { return phenotype; }
		set { phenotype= value; }
	}
	
	public string ToString() {
		int length = type.ToString().Length;
		string padding="";
		for(int x=length; x<8; x++)
			padding+=" ";
		
		return type.ToString()	+ ":" + padding +"\t" + Max.ToString() +  " - " + Min.ToString();
	}
	
	public void duplicate(Chromosome copy) {
		type= copy.type;
		Min= copy.Min;
		Max= copy.Max;
	}
	
	public void GeneratePhenotype() {
		this.phenotype= GenePool.GetPhenotype(type, max);
	}
	
}